package routers

import (
	"github.com/gin-gonic/gin"
	"zhanyan/controller"
)

func UserRouter(r *gin.Engine) {

	user := r.Group("/user")
	{
		user.GET("/isExist", controller.UserIsExist)
		user.GET("/getStudent/:id", controller.GetStudent)
		user.GET("/getTeacher/:id", controller.GetTeacher)
		user.GET("/getAllStudent", controller.GetAllStudent)
		user.GET("/getAllTeacher", controller.GetAllTeacher)
		user.GET("/getStudentPage", controller.GetStudentPage)
		user.GET("/getTeacherPage", controller.GetTeacherPage)
		user.GET("/getTeacherInClass/:id", controller.GetTeacherInClass)
		user.POST("/addTeacher", controller.AddTeacher)
		user.POST("/addStudent", controller.AddStudent)
		user.PUT("/updateStudent", controller.UpdateStudent)
		user.PUT("/updateTeacher", controller.UpdateTeacher)
		user.DELETE("/deleteStudent/:id", controller.DeleteStudent)
		user.DELETE("/deleteTeacher/:id", controller.DeleteTeacher)
		user.DELETE("/deleteTeacherInClass", controller.DeleteTeacherInClass)
		user.DELETE("/deleteTeacherAllClass", controller.DeleteTeacherAllClass)
	}

}
